<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>abstractdialogplugin_test.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">abstractdialogplugin_test.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/editor/plugins/abstractdialogplugin_test.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/editor/plugins/abstractdialogplugin_test.js</div>
    </div>
  </div>
<hr/>


   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="createDialog"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">createDialog<span class="args">(<span class="arg">dialogDomHelper</span>)</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_ui_editor_AbstractDialog.html">goog.ui.editor.AbstractDialog</a></span>
      </div>


     <div class="entryOverview">
       Creates a concrete instance of goog.ui.editor.AbstractDialog by adding
a plain implementation of createDialogControl().

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dialogDomHelper</span>
        : <span class="type"><a href="class_goog_dom_DomHelper.html">goog.dom.DomHelper</a></span>
        <div class="entryOverview">The dom helper to be used to
    create the dialog.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_ui_editor_AbstractDialog.html">goog.ui.editor.AbstractDialog</a></span>&nbsp;
            The created dialog.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line91">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="createDialogPlugin"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">createDialogPlugin<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_editor_plugins_AbstractDialogPlugin.html">goog.editor.plugins.AbstractDialogPlugin</a></span>
      </div>


     <div class="entryOverview">
       Creates a concrete instance of the abstract class
goog.editor.plugins.AbstractDialogPlugin
and registers it with the mock editable field being used.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_editor_plugins_AbstractDialogPlugin.html">goog.editor.plugins.AbstractDialogPlugin</a></span>&nbsp;
            The created plugin.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line106">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="expectClosed"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">expectClosed<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets up the mock event handler to expect a CLOSED event.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line141">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="expectOpened"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">expectOpened<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets up the mock event handler to expect an OPENED event.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line124">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="setUp"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">setUp<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line50">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="setUpMockRange"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">setUpMockRange<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line62">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="setUpRealEditableField"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">setUpRealEditableField<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Setup a real editable field (instead of a mock) and register the plugin to
it.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line338">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="tearDown"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">tearDown<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line70">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="tearDownRealEditableField"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">tearDownRealEditableField<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Tear down the real editable field.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line353">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="testDebounceSelectionChange"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testDebounceSelectionChange<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests that after the dialog is hidden via a keystroke, the editable field
doesn't fire an extra SELECTIONCHANGE event due to the keyup from that
keystroke.
There is also a robot test in dialog_robot.html to test debouncing the
SELECTIONCHANGE event when the dialog closes.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line372">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="testExecAndDispose"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testExecAndDispose<span class="args">(<span class="arg">opt_reuse</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests the simple flow of calling execCommand (which opens the
dialog) and immediately disposing of the plugin (which closes the dialog).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_reuse</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether to set the plugin to reuse its dialog.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line160">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="testExecAndDisposeReuse"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testExecAndDisposeReuse<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests execCommand and dispose while reusing the dialog.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line187">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="testExecAndHide"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testExecAndHide<span class="args">(<span class="arg">reuse</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests the flow of calling execCommand (which opens the dialog) and
then hiding it (simulating that a user did somthing to cause the dialog to
close).

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">reuse</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">Whether to set the plugin to reuse its dialog.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line198">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="testExecAndHideReuse"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testExecAndHideReuse<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests execCommand and hide while reusing the dialog.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line233">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="testExecTwice"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testExecTwice<span class="args">(<span class="arg">reuse</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests the flow of calling execCommand (which opens a dialog) and
then calling it again before the first dialog is closed. This is not
something anyone should be doing since dialogs are (usually?) modal so the
user can't do another execCommand before closing the first dialog. But
since the API makes it possible, I thought it would be good to guard
against and unit test.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">reuse</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">Whether to set the plugin to reuse its dialog.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line247">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="testExecTwiceReuse"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testExecTwiceReuse<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests execCommand twice while reusing the dialog.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line295">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="testRestoreSelection"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace"></span><span class="entryName">testRestoreSelection<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Tests that the selection is cleared when the dialog opens and is
correctly restored after it closes.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line309">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






  <h2>Global Variables</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="fieldObj"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">fieldObj</span>
        : <span class="type"><a href="class_goog_editor_Field.html">goog.editor.Field</a></span>
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line46">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="mockClosedHandler"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">mockClosedHandler</span>
        : <span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line40">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="mockCtrl"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">mockCtrl</span>
        : <span class="type"><a href="class_goog_testing_MockControl.html">goog.testing.MockControl</a></span>
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line36">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="mockField"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">mockField</span>
        : <span class="type"><a href="class_goog_testing_editor_FieldMock.html">goog.testing.editor.FieldMock</a></span>
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line37">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="mockHandler"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">mockHandler</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line48">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="mockOpenedHandler"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">mockOpenedHandler</span>
        : <span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line39">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="mockSavedRange"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">mockSavedRange</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_editor_plugins_abstractdialogplugin_test.js.source.html#line38">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory plugins</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/editor/plugins/abstractdialogplugin_test.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
